/**
 * 郭楠project
 * com.gn.mongo.dao
 * XcxMarketDaoImpl.java
 * 创建人:TonyGuo 
 * 时间：2017年1月10日-下午9:17:30 
 * 2017Tm公司-版权所有
 */
package com.gn.mongo.dao;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Repository;

import com.gn.commons.BaseMongo;
import com.gn.entity.Article;
import com.gn.entity.XcxMarket;
import com.gn.util.CommonUtils;
import com.taoxeo.commons.lang.IdUtils;

/**
 * 
 * XcxMarketDaoImpl
 * 创建人:TonyGuo
 * 时间：2017年1月10日-下午9:17:30 
 * @version 1.0.0
 * 
 */
@Repository
public class XcxMarketDaoImpl extends BaseMongo<XcxMarket, String> implements XcxMarketDao {
	private static Logger logger = LoggerFactory.getLogger(XcxMarketDaoImpl.class);

	@Resource
	MongoTemplate mongoTemplate;
	
	@Override
	public List<XcxMarket> findAll() {
		return mongoTemplate.findAll(XcxMarket.class);
	}

	public void save(XcxMarket xcxMarket){
		xcxMarket.setId(IdUtils.uuid());
		logger.info("【xcxMarket==：{}】",xcxMarket.toString());
		mongoTemplate.save(xcxMarket);
	}
	
	@Override
	public long count() {
		return count(new Query());
	}
	
	
}
